<script>
/**
 * Header.vue
 * @module @/components
 * @desc 公共页头，包含：首页、写博客、登录、注册、用户名、退出、搜索、面包屑
 * @author chengxue@bolean
 * @date 2018年04月03日14:05:43
 * @props:
 * @param {Object} [breadcrumb] - 面包屑
 * @param {String} [username] - 用户名
 * @param {Boolean} [isShow] - 是否展示搜索框
 * @example 调用示例
 *  <bolean-header :breadcrumb="breadcrumb" :username="username" :isShow="isShow"></bolean-header>
 */
let navs = {
  index: {
    item: "首页",
    link: "/",
    show: true
  },
  writeBlog: {
    item: "写博客",
    link: "/writeBlog",
    show: true
  },
  login: {
    item: "登录",
    link: "/login",
    show: true
  },
  register: {
    item: "注册",
    link: "/register",
    show: true
  },
  name: {
    item: "",
    link: "",
    show: false
  },
  logout: {
    item: "退出",
    link: "",
    show: false
  }
};
export default {
  data() {
    return {
      search: "",  // 搜索框
      navs,  // 导航栏数据
    };
  },
  props: {
    breadcrumb: {  // 面包屑
      type: Array,
      default: function() {
        return [];
      }
    },
    username: {  // 用户名
      type: String,
      default: ""
    },
    isShow: {  // 是否显示输入框
      type: Boolean,
      default: true
    }
  }
};
</script>
